<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 药品字典表
 *
 * Class CreateMedicalDrugsTable
 */
class CreateMedicalDrugsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //  注释部分需要时添加

        Schema::create('st_drug_dictionary', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->comment('药品名字');
            $table->unsignedInteger('doctor_id')->comment('添加药品的医生ID');
//            $table->unsignedInteger('hospital_id')->default(0)->comment('医院id,0表示平台(通用药品)');
            $table->unsignedMediumInteger('sort')->default(0)->comment('排序');
            $table->tinyInteger('is_recommend')->default(0)->comment('是否推荐：0不推荐，1推荐');
            $table->tinyInteger('is_insulin')->default(0)->comment('是否是胰岛素：0否，1是');
            $table->tinyInteger('type')->default(0)->comment('药品分类，1西药2中药');
            $table->tinyInteger('group')->default(0)->comment('药品分组类型');
            $table->string('pic')->nullable()->comment('药品图片');
            $table->string('remark')->default('')->comment('备注');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('st_drug_dictionary');
    }
}
